

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Color Picker</title>

<script type="text/vbscript">
function cmouseover(num)
	set dc=document.getElementById("displaycell")
	
	dc.style.backgroundColor="#" & num
	dc.innerhtml="#" & ucase(num)
end function

function cclick(num)
	set cc=document.getElementById("chosencell")
	
	cc.style.backgroundColor="#" & num
	cc.innerhtml="#" & ucase(num)
end function

function btnok_click()
	set cc=document.getElementById("chosencell")
	if left(cc.innerhtml,1)<>"#" then
		msgbox "not a color"
	else
		msgbox cc.innerhtml
	end if
end function

function btncancel_click()
	window.close()
end function
</script>
<style type="text/css">
body { margin:0px }
</style>
</head>

<body>
<script type="text/vbscript">
ar1=array("00","33","66","99","bb","dd","ff")
ar2=array("00","44","88","cc","ff")
ar3=array("00","11","22","33","44","55","66","77","88","99","aa","bb","cc","dd","ee","ff")

h=h & "<table border=1 bgcolor=#cccccc style='font-size:8px'>"
for f=0 to 15
	h=h & "<tr>" & vbcrlf
	for s=0 to 4
		
		for t=0 to 6
			c1=ar3(f)
			c2=ar2(s)
			c3=ar1(t)
			c= c1 & c2 & c3
			h=h & "<td bgcolor='#" & c & "' onmouseover= " & chr(34) & "cmouseover ('" & c & "')" & chr(34) & " onclick=" & chr(34) & "cclick('" & c & "')" & chr(34) & " style='cursor:pointer; width:20; height:20'> &nbsp;&nbsp;&nbsp;&nbsp; </td>" & vbcrlf
		next
		
	next
	h=h & "</tr>" & vbcrlf
next
h=h & "<tr><td colspan=11 id='displaycell' style='font-size:14px; font-family:Arial, Helvetica, sans-serif;  text-align:center' align='left'> &nbsp; </td>" & vbcrlf 

h=h & "<td colspan=11 id='chosencell' style='font-size:14px; font-family:Arial, Helvetica, sans-serif;  text-align:center' align='left'> &nbsp; </td>" & vbcrlf 

h=h & "<td colspan=13 style='border:none;' align='right'>" & vbcrlf

h=h & "<input type=button id=btnok value='   OK    ' onclick='btnok_click()'> &nbsp;" & vbcrlf
h=h & "<input type=button id=btncancel value=CANCEL onclick='btncancel_click()'>" & vbcrlf
h=h & "</td></tr>"
h=h & "</table>"

document.write (h)
</script>

</body>
</html>
